home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: getchar() problems!
- Date: Wed, 17 Jan 96 17:26:38 GMT
- Organization: none
- Message-ID: <821899598snz@genesis.demon.co.uk>
- References: <DL2wFD.8BK@cdf.toronto.edu> <4dgp50$6bg@comet.connix.com>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <4dgp50$6bg@comet.connix.com>
- shawley@connix.com "Scott Hawley" writes:
-
- >That is exactly how getchar is suppose to work. getchar will not actually
- >start working until a <ENTER> key is pressed.
-
- This is how getchar() can work but there's no requirement that it work
- like this. getchar() will return a character if there is one available,
- it is up to the implementation/environment to decide when a character is
- available. Where the environment implements line editing it is natural to
- wait until a complete line is submitted i.e. until <ENTER> (or whatever)
- is pressed.
-
- >If you are on a unix system you probally won't be able to get a single
- >character at a time with the compilier you have unless you use curses.
-
- This can be done with Curses but it carries a lot of baggage if you're
- not interested in any of the other Curses features. The normal way to
- approach this is to turn off line editing in the TTY (see man termio or
- man termios). This configuration still conforms to the C language standard.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-